﻿
var xmlHttp_request
 
function ajaxRequest(holder,data,settings)
{
    xmlHttp_request = GetXmlHttpObject_parcel()
    if(xmlHttp_request == null)
    {
        alert("browser does not support HTTP Request")
        return
    }
    var url = data
    
    xmlHttp_request.onreadystatechange = stateChanged
    xmlHttp_request.open("GET",url,true)
    xmlHttp_request.send(null)
    
    function stateChanged() { checkState(holder,settings) }
     
}
 
function checkState(holder,settings)
{
    if(xmlHttp_request.readyState==4 || xmlHttp_request.readyState == "complete")
     { document.getElementById(holder).innerHTML = xmlHttp_request.responseText;
        if(settings == "true") {loadSettings()}
      }
}
 
function GetXmlHttpObject_parcel()
{
    var xmlHttp_request = null;
    try {xmlHttp_request = new XMLHttpRequest(); }
      catch (e) {try {xmlHttp_request = new ActiveXObject("Msxml2.XMLHTTP");}
        catch (e) {xmlHttp_request = new ActiveXObject("Microsoft.XMLHTTP");}
         }
        
    return xmlHttp_request;
}
 
